<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AddIndexToAgent extends Migrator
{
    public function up()
    {
        $sql = <<<SQL
ALTER TABLE `agent`
ADD UNIQUE INDEX `merchant_id` (`merchant_id`) USING BTREE ,
ADD UNIQUE INDEX `appid` (`app_id`) USING BTREE ;


SQL;
        $this->execute($sql);

    }

    public function down()
    {
        $sql = <<<SQL
ALTER TABLE `agent`
DROP INDEX `merchant_id`,
DROP INDEX `appid`;


SQL;
        $this->execute($sql);

    }
}
